//
//  XDNavVController.m
//  代理练习
//
//  Created by bd on 17/3/10.
//  Copyright © 2017年 bd. All rights reserved.
//

#import "XDNavVController.h"

@interface XDNavVController ()

@end

@implementation XDNavVController

+ (void)initialize
{
    // 设置导航栏主题
    [self creatNavBarTheme];
}
- (void)viewDidLoad {
    [super viewDidLoad];

    
    
}

//设置导航栏主题
+ (void)creatNavBarTheme{
    
    UINavigationBar *navBar = [UINavigationBar appearance];
    navBar.barTintColor = [UIColor redColor];
    
    // 8.0以前设置标题属性
    if ([[[UIDevice currentDevice] systemVersion] floatValue] < 8.0) {
        NSMutableDictionary *texAttrs = [NSMutableDictionary dictionary];
        texAttrs[NSForegroundColorAttributeName] = [UIColor whiteColor];
        texAttrs[NSShadowAttributeName] = [NSValue valueWithUIOffset:UIOffsetZero];
        texAttrs[NSFontAttributeName] = [UIFont boldSystemFontOfSize:18];
        [navBar setTitleTextAttributes:texAttrs];
        
    }else //iOS 9修改标题颜色和字体的方法
    {
        [navBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
        
    }
}

@end
